package cn.enilu.flash.bean.entity.order;

import cn.enilu.flash.bean.entity.BaseEntity;
import lombok.Data;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import java.math.BigDecimal;
import java.util.Date;

@Entity(name = "t_task_order")
@Table(appliesTo = "t_task_order", comment = "接单订单类")
@Data
@EntityListeners(AuditingEntityListener.class)
public class TaskOrder extends BaseEntity {
    @Column(columnDefinition = "bigint comment '任务ID'")
    private Long taskId;

    @Column(columnDefinition = "bigint comment '发布人ID'")
    private Long issuerId;

    @Column(columnDefinition = "int(2) comment '订单状态:1待提交，2审核中，3已完成，4未通过，5已申诉，6已取消'")
    private Integer state;

    @Column(columnDefinition = "VARCHAR(32) comment '任务标题'")
    private String taskTitle;

    @Column(columnDefinition = "datetime comment '提交凭证时间'")
    private Date submitTime;

    @Column(columnDefinition = "datetime COMMENT '提交凭证截至时间'")
    private Date timeLimit;

    @Column(columnDefinition = "datetime COMMENT '订单自动审核通过截止时间'")
    private Date autoAuditTime;

    @Column(columnDefinition = "datetime COMMENT '审核的时间'")
    private Date auditTime;

    @Column(columnDefinition = "decimal(10,2) COMMENT '任务奖励金额'")
    private BigDecimal money;

    @Column(columnDefinition = "datetime COMMENT '审核不通过时，自动放弃的截止时间。'")
    private Date autoWaiverTime;

    @Column(columnDefinition = "int(2) COMMENT '审核结果:1通过，2不通过，3申诉通过（管理后台专用）'")
    private Integer result;

    @Column(columnDefinition = "VARCHAR(255) COMMENT '不通过原因'")
    private String reason;

    @Column(columnDefinition = "VARCHAR(255) COMMENT '接单人申诉内容'")
    private String appeal;

    @Column(columnDefinition = "VARCHAR(255) COMMENT '平台处理申诉回复内容'")
    private String failureRecovery;

    @Column(columnDefinition = "bigint COMMENT '平台处理接单人申诉的用户编号'")
    private Long sysUserId;
}
